import { instance } from "../request";

export const roleListService = ()=>{
    return instance.get("/sys/role")
}

export const roleUpdateService = (id,roleDetails)=>{
    return instance.put(`/sys/role/${id}`,roleDetails)
}

export const permissionListByRoleIdService = (roleId)=>{
    return instance.get(`/sys/role/permission/${roleId}`)
}

export const rolePermissionUpdateService = (roleId,permissionIds)=>{
    return instance.post(`/sys/role/permission/${roleId}`,permissionIds)
}

export const roleDeleteService = (roleIds)=>{
    return instance.delete("/sys/role",roleIds)
}

export const roleDeleteByRoleIdService = (id)=>{
     return instance.delete(`/sys/role/${id}`)
}